//
//  AXAccomplishRegisterVC.m
//  AnXin100
//
//  Created by 天质弘耕 on 2018/10/10.
//  Copyright © 2018年 tzhg. All rights reserved.
//

#import "AXAccomplishRegisterVC.h"
#import "UIView+SDAutoLayout.h"
#import "ZXCategories.h"
#import "AXLoginViewController.h"
#import "HBDNavigationController.h"
#import "UIViewController+HBD.h"
#import "AXRegisterViewController.h"

@interface AXAccomplishRegisterVC ()
/** titile */
@property (nonatomic ,strong) UILabel *titleLabel;
/** 完成图标 */
@property (nonatomic ,strong) UIImageView *imageView;
/** hint提示修改成功 */
@property (nonatomic ,strong) UILabel *hintLabel;
/** 修改完成按钮 */
@property (nonatomic ,strong) UIButton *accomButton;


@end

@implementation AXAccomplishRegisterVC

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor whiteColor];
    [self creatView];
    [self setlayout];
    
}


- (void)creatView {
    
    //客服按钮
    UIButton *backBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    [backBtn setImage:[UIImage imageNamed:@"back"] forState:UIControlStateNormal];
    backBtn.frame = CGRectMake(0, 0, 30, 30);
    [backBtn addTarget:self action:@selector(back:) forControlEvents:UIControlEventTouchUpInside];
    UIBarButtonItem *rightItem = [[UIBarButtonItem alloc]initWithCustomView:backBtn];
    self.navigationItem.leftBarButtonItem = rightItem;
    /** 搜索 */
    self.titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, 0, 100, 30)];
    self.titleLabel.text = @"注册完成";
    self.titleLabel.textAlignment = NSTextAlignmentCenter;
    self.titleLabel.font = [UIFont systemFontOfSize:16];
    self.titleLabel.textColor = [UIColor colorWithHex:0x29b566];
    self.navigationItem.titleView = self.titleLabel;
    
    self.imageView = [[UIImageView alloc]init];
    self.imageView.image = [UIImage imageNamed:@"finish"];
    [self.view addSubview:self.imageView];
    
    self.hintLabel = [[UILabel alloc]init];
    self.hintLabel.font = [UIFont systemFontOfSize:20];
    self.hintLabel.textAlignment = NSTextAlignmentCenter;
    self.hintLabel.text = @"恭喜您注册成功";
    [self.view addSubview:self.hintLabel];
    
    self.accomButton = [[UIButton alloc]init];  
    [self.accomButton addTarget:self action:@selector(acomplish:) forControlEvents:UIControlEventTouchUpInside];
    self.accomButton.backgroundColor = [UIColor colorWithHex:0x3bde72];
    [self.accomButton setTitle:@"修改完成" forState:UIControlStateNormal];
    [self.accomButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    self.accomButton.cornerRadius = 10;
    [self.view addSubview:self.accomButton];
    
    
}

- (void)setlayout {
    
    
    
   self.imageView.sd_layout
    .centerXEqualToView(self.view)
    .topSpaceToView(self.view, 150)
    .widthIs(150)
    .heightIs(150);
    
    self.hintLabel.sd_layout
    .centerXEqualToView(self.view)
    .topSpaceToView(self.imageView, 50)
    .widthIs(SCREEN_WIDTH)
    .heightIs(30);
    
    self.accomButton.sd_layout
    .leftSpaceToView(self.view, 50)
    .topSpaceToView(self.hintLabel, 50)
    .widthIs(SCREEN_WIDTH - 100)
    .heightIs(40);
    
    
}


#pragma mark - Action
/** 修改完成按钮 */
- (void)acomplish:(UIButton *)btn {

    AXLoginViewController *findVC = [[AXLoginViewController alloc]init];
    //resVC.hbd_barHidden = YES;
    findVC.hbd_barAlpha = 0;
    [self.navigationController popToRootViewControllerAnimated:YES];
    
}
/** 返回按钮 */
- (void)back:(UIButton *)btn {
    AXRegisterViewController *resVC = [[AXRegisterViewController alloc]init];
    //resVC.hbd_barHidden = YES;
    resVC.hbd_barAlpha = 0;
    [self.navigationController pushViewController:resVC animated:YES];

}


@end
